﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Entity;

namespace HdipCricketClub.Models
{
    public class ResultRepository
    {
        CricketClubEntities db = new CricketClubEntities();

        public List<Result> FindAllResults()
        {
            return db.Results.Include("Fixture").ToList();
        }
        
        public void EnterResult(int fixtureId)
        {
            Result result = new Result() { fixture_id = fixtureId };

            db.Results.AddObject(result);
            db.SaveChanges();
        }
    }
}